<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		
	<a>点我试试</a>
	<input type="button" id="btn" value="加链接"/>
	<input type="button" id="btnr" value="去链接"/>
	<script type="text/javascript">
		var e_a = document.getElementsByTagName("a")[0];
		document.getElementById("btn").onclick = function(){
			e_a.setAttribute("href","http://www.zjitc.net");
			alert("ok!");
		}
		document.getElementById("btnr").onclick = function(){
			e_a.removeAttribute("href");
			alert("ok!");
		}
	</script>
	</body>
</html>
